﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace app
{
    class Stats
    {
        byte[] buffer;

        byte offset = 0;

        public byte distance
        {
            get
            {
                int sum = 0;
                for (int i = 0; i < Parameters.statsBufferSize; i++)
                    sum += buffer[i];

                return Convert.ToByte(sum / Parameters.statsBufferSize);
            }
        }

        public Stats()
        {
            buffer = new byte[Parameters.statsBufferSize];
        }

        public Stats(IEnumerable<byte> data)
        {
            buffer = data.ToArray();
        }

        public IEnumerable<byte> ToBytes()
        {
            return buffer;
        }
    }
}
